{% load render_bundle from webpack_loader %}

{% with segment_key=site.siteconfiguration.segment_key %}
  {% if segment_key %}
    <script type="application/javascript">
        window.edx.segment = {
            key: '{{ segment_key }}'
        };
    </script>
    {% render_bundle 'analytics' 'js' %}
  {% endif %}
{% endwith %}
